Optimal. Leaf size=36 \[ -\frac {(a+b) \tanh (c+d x)}{d}+x (a+b)-\frac {b \tanh ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3631, 3473, 8} \[ -\frac {(a+b) \tanh (c+d x)}{d}+x (a+b)-\frac {b \tanh ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3473
Rule 3631
Rubi steps
\begin {align*} \int \tanh ^2(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=-\frac {b \tanh ^3(c+d x)}{3 d}-(-a-b) \int \tanh ^2(c+d x) \, dx\\ &=-\frac {(a+b) \tanh (c+d x)}{d}-\frac {b \tanh ^3(c+d x)}{3 d}-(-a-b) \int 1 \, dx\\ &=(a+b) x-\frac {(a+b) \tanh (c+d x)}{d}-\frac {b \tanh ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 65, normalized size = 1.81 \[ \frac {a \tanh ^{-1}(\tanh (c+d x))}{d}-\frac {a \tanh (c+d x)}{d}+\frac {b \tanh ^{-1}(\tanh (c+d x))}{d}-\frac {b \tanh ^3(c+d x)}{3 d}-\frac {b \tanh (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.41, size = 160, normalized size = 4.44 \[ \frac {{\left (3 \, {\left (a + b\right )} d x + 3 \, a + 4 \, b\right )} \cosh \left (d x + c\right )^{3} + 3 \, {\left (3 \, {\left (a + b\right )} d x + 3 \, a + 4 \, b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} - {\left (3 \, a + 4 \, b\right )} \sinh \left (d x + c\right )^{3} + 3 \, {\left (3 \, {\left (a + b\right )} d x + 3 \, a + 4 \, b\right )} \cosh \left (d x + c\right ) - 3 \, {\left ({\left (3 \, a + 4 \, b\right )} \cosh \left (d x + c\right )^{2} + a\right )} \sinh \left (d x + c\right )}{3 \, {\left (d \cosh \left (d x + c\right )^{3} + 3 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{2} + 3 \, d \cosh \left (d x + c\right )\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.17, size = 86, normalized size = 2.39 \[ \frac {3 \, {\left (d x + c\right )} {\left (a + b\right )} + \frac {2 \, {\left (3 \, a e^{\left (4 \, d x + 4 \, c\right )} + 6 \, b e^{\left (4 \, d x + 4 \, c\right )} + 6 \, a e^{\left (2 \, d x + 2 \, c\right )} + 6 \, b e^{\left (2 \, d x + 2 \, c\right )} + 3 \, a + 4 \, b\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.02, size = 100, normalized size = 2.78 \[ -\frac {b \left (\tanh ^{3}\left (d x +c \right )\right )}{3 d}-\frac {a \tanh \left (d x +c \right )}{d}-\frac {b \tanh \left (d x +c \right )}{d}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right ) a}{2 d}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right ) b}{2 d}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right ) a}{2 d}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right ) b}{2 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.33, size = 105, normalized size = 2.92 \[ \frac {1}{3} \, b {\left (3 \, x + \frac {3 \, c}{d} - \frac {4 \, {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + 2\right )}}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} + a {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.17, size = 34, normalized size = 0.94 \[ x\,\left (a+b\right )-\frac {b\,{\mathrm {tanh}\left (c+d\,x\right )}^3}{3\,d}-\frac {\mathrm {tanh}\left (c+d\,x\right )\,\left (a+b\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.29, size = 54, normalized size = 1.50 \[ \begin {cases} a x - \frac {a \tanh {\left (c + d x \right )}}{d} + b x - \frac {b \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac {b \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\relax (c )}\right ) \tanh ^{2}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________